#include <bits/stdc++.h>
#define MAXN 200010
using namespace std;

inline int get_num() {
    int k = 0, f = 1;
    char c = getchar();
    for(; !isdigit(c); c = getchar())if(c == '-') f = -1;
    for(; isdigit(c); c = getchar()) k = k * 10 + c - '0';
    return k * f;
}

int L, n, type;

    int mx[MAXN << 2], mi[MAXN << 2], lz[MAXN << 2], lt[MAXN << 2], rt[MAXN << 2];
    void push(int x) {
    	int lc = x << 1;
		int rc = x << 1 | 1;
		lz[lc] += lz[x];
		lz[rc] += lz[x];
		mx[lc] += lz[x];
		mx[rc] += lz[x];
		mi[lc] += lz[x];
		mi[rc] += lz[x];
		lt[lc] += lz[x];
		lt[rc] += lz[x];
		rt[lc] += lz[x];
		rt[rc] += lz[x];
		lz[x] = 0;       
    }
    void insert(int x, int l, int r, int s, int t) {
        //printf("x : %d l : %d r : %d s : %d t : %d\n", x, l, r, s, t);
        int tmp = (type == 2) ? -1 : 1;
        if(lz[x]) push(x);
		if(s == l && r == t) {
            lz[x] += tmp;
            mi[x] += tmp;
            mx[x] += tmp;
            lt[x] += tmp;
        	rt[x] += tmp;
            return;
        } else if(t <= (l + r) >> 1) {
            insert(x << 1, l, (l + r) >> 1, s, t);
        } else if(s > (l + r) >> 1) {
            insert(x << 1 | 1, ((l + r) >> 1) + 1, r, s, t);
        } else {
            insert(x << 1, l, (l + r) >> 1, s, (l + r) >> 1);
            insert(x << 1 | 1, ((l + r) >> 1) + 1, r, ((l + r) >> 1) + 1, t);
        }
        mx[x] = max(mx[x << 1], mx[x << 1 | 1]);
        mi[x] = min(mi[x << 1], mi[x << 1 | 1]); 
        lt[x] = lt[x << 1];
        rt[x] = rt[x << 1 | 1];
    }
    int cnt(int x, int l, int r) {
        push(x);
        if(mi[x]) return 1;
        if(!mx[x]) return 0;
        if(lz[x]) push(x);
		int ans = 0;
        ans += cnt(x << 1, l, (l + r) >> 1);
        ans += cnt(x << 1 | 1, ((l + r) >> 1) + 1, r);
        if(rt[x << 1] && lt[x << 1 | 1]) ans--;
        //printf("x = %d l = %d r = %d   ans = %d\n", x, l, r, ans);
        return ans;
    }
    int lth(int x, int l, int r) {
        if(mi[x]) return (r - l) + 1;
        if(!mx[x]) return 0;
        if(lz[x]) push(x);
        return lth(x << 1, l, (l + r) >> 1) + lth(x << 1 | 1, ((l + r) >> 1) + 1, r);
    }



int main() {
//    freopen("in.txt", "r", stdin);
    freopen("xdfg.in", "r", stdin);
    freopen("xdfg.out", "w", stdout);
    L = get_num();
    n = get_num();
    while(n--) {
        type = get_num();
        int s = get_num();
        int t = s + get_num() - 1;
        insert(1, 1, L, s, t);
        //printf("-11111\n");
        printf("%d ", cnt(1, 1, L));
        printf("%d\n", lth(1, 1, L));
    }
}
